package com.buba.mapper;

import cn.hutool.json.JSONObject;
import entity.Message;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @descriptions: 聊天记录mapper
 * @author: ZQ
 * @date: 2023/3/6 15:59
 */
@Mapper
@Repository
public interface MessageMapper {

    /**
     * @descriptions 撤回消息
     * @author ZQ
     * @date 2023/3/6 14:58
     * @param id
     * @return void
     */
    void withdrawMessage(String id);

    /**
     * @descriptions 查询聊天记录
     * @author ZQ
     * @date 2023/3/6 14:59
     * @param sessionId
     * @return java.util.List<java.util.Map>
     */
    List<Map> readMessage(Long sessionId);

    /**
     * @descriptions 查询一条聊天记录
     * @author ZQ
     * @date 2023/3/6 15:01
     * @param sessionId
     * @return entity.Message
     */
    Message readMessageBySessionId(Long sessionId);

    /**
     * @descriptions 添加聊天信息
     * @author ZQ
     * @date 2023/3/6 15:03
     * @param message
     * @return void
     */
    void insertMessage(Message message);
}